package com.evil.application.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.evil.common.application.enums.button.ButtonSourceTypeEnum;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 自定义按钮表
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
@TableName(value = "evil_application_button")
public class ApplicationButton implements Serializable {

    /**
     * id
     */
    @TableId(value = "button_id", type = IdType.AUTO)
    private Long buttonId;

    /**
     * 企业id
     */
    @TableField(value = "enterprise_id")
    private Long enterpriseId;

    /**
     * 按钮key
     */
    @TableField(value = "button_key")
    private String buttonKey;

    /**
     * 源id
     */
    @TableField(value = "source_id")
    private Long sourceId;

    /**
     * 源类型（1-应用按钮，2-应用视图按钮）
     *
     * @see ButtonSourceTypeEnum#getId()
     */
    @TableField(value = "source_type")
    private Integer sourceType;

    /**
     * 版本(0:发布版, 1:设计版)
     */
    @TableField(value = "version")
    private Integer version;

    /**
     * 源按钮id
     */
    @TableField(value = "source_button_id")
    private Long sourceButtonId;

    /**
     * 按钮名称
     */
    @TableField(value = "button_name")
    private String buttonName;

    /**
     * 样式
     */
    @TableField(value = "`style`")
    private String style;

    /**
     * 触发动作(1:添加数据,2:跳转链接)
     */
    @TableField(value = "trigger_action")
    private Integer triggerAction;

    /**
     * 触发条件(0:关闭, 1:开)
     */
    @TableField(value = "trigger_condition")
    private Integer triggerCondition;

    /**
     * 链接
     */
    @TableField(value = "link")
    private String link;

    /**
     * 目标应用id
     */
    @TableField(value = "target_application_id")
    private Long targetApplicationId;

    /**
     * 权限状态(0:全体, 1:指定)
     */
    @TableField(value = "permission_status")
    private Integer permissionStatus;

    /**
     * 密码状态(0:关闭, 1:开)
     */
    @TableField(value = "password_status")
    private Integer passwordStatus;

    /**
     * 密码
     */
    @TableField(value = "`password`")
    private String password;

    /**
     * 列表页展示(0:关闭, 1:开)
     */
    @TableField(value = "in_table")
    private Integer inTable;

    /**
     * 详情页展示(0:关闭, 1:开)
     */
    @TableField(value = "in_detail")
    private Integer inDetail;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 是否已删除(0:否, 1:是)
     */
    @TableField(value = "is_deleted")
    private Integer isDeleted;

    /**
     * 创建人
     */
    @TableField(value = "creator_id")
    private Long creatorId;

    /**
     * 创建人名字
     */
    @TableField(value = "creator_name")
    private String creatorName;

    /**
     * 修改操作人
     */
    @TableField(value = "modifier_id")
    private Long modifierId;

    /**
     * 修改操作人名字
     */
    @TableField(value = "modifier_name")
    private String modifierName;

    /**
     * 创建时间
     */
    @TableField(value = "created")
    private Date created;

    /**
     * 更新时间
     */
    @TableField(value = "updated")
    private Date updated;

    @Serial
    private static final long serialVersionUID = 1L;

    public static final String COL_BUTTON_ID = "button_id";

    public static final String COL_ENTERPRISE_ID = "enterprise_id";

    public static final String COL_BUTTON_KEY = "button_key";

    public static final String COL_SOURCE_ID = "source_id";

    public static final String COL_SOURCE_TYPE = "source_type";

    public static final String COL_VERSION = "version";

    public static final String COL_SOURCE_BUTTON_ID = "source_button_id";

    public static final String COL_BUTTON_NAME = "button_name";

    public static final String COL_STYLE = "style";

    public static final String COL_TRIGGER_ACTION = "trigger_action";

    public static final String COL_TRIGGER_CONDITION = "trigger_condition";

    public static final String COL_LINK = "link";

    public static final String COL_TARGET_APPLICATION_ID = "target_application_id";

    public static final String COL_PERMISSION_STATUS = "permission_status";

    public static final String COL_PASSWORD_STATUS = "password_status";

    public static final String COL_PASSWORD = "password";

    public static final String COL_IN_TABLE = "in_table";

    public static final String COL_IN_DETAIL = "in_detail";

    public static final String COL_REMARK = "remark";

    public static final String COL_IS_DELETED = "is_deleted";

    public static final String COL_CREATOR_ID = "creator_id";

    public static final String COL_CREATOR_NAME = "creator_name";

    public static final String COL_MODIFIER_ID = "modifier_id";

    public static final String COL_MODIFIER_NAME = "modifier_name";

    public static final String COL_CREATED = "created";

    public static final String COL_UPDATED = "updated";
}
